/*
 *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions are met:
 *
 *  Redistributions of source code must retain the above copyright notice,
 *  this list of conditions and the following disclaimer.
 *  Redistributions in binary form must reproduce the above copyright
 *  notice, this list of conditions and the following disclaimer in the
 *  documentation and/or other materials provided with the distribution.
 *  Neither the name of the dreamlu.net developer nor the names of its
 *  contributors may be used to endorse or promote products derived from
 *  this software without specific prior written permission.
 *  Author: Chill 庄骞 (smallchill@163.com)
 */
package org.springblade.mach.mapper;

import org.apache.ibatis.annotations.Param;
import org.springblade.mach.entity.DrawingCategory;
import org.springblade.mach.entity.DrawingInfo;
import org.springblade.mach.vo.DrawingInfoVO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springblade.modules.system.vo.MenuVO;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;
import java.util.Map;

/**
 *  Mapper 接口
 *
 * @author LY
 * @since 2021-03-05
 */
public interface DrawingInfoMapper extends BaseMapper<DrawingInfo> {
	/**
	 * 整合info_node寻找当前根节点下，所有子节点的信息
	 */
	List<DrawingInfoVO> getChileNodeByPId(Long pid);


	List<DrawingInfoVO> getTreeList( @Param("drawingInfo") DrawingInfo drawingInfo);


	List<DrawingInfoVO> lazyTree(Long parentCode , Long id);

	/**
	 * 自定义分页
	 * @param page
	 * @param drawingInfo
	 * @return
	 */
	List<DrawingInfoVO> selectDrawingInfoPage(IPage page, @Param("drawingInfo") DrawingInfo drawingInfo);

	/**
	 * 懒加载菜单列表
	 */
	List<DrawingInfoVO> lazyList(Long parentId, Map<String,Object> drawingInfo);

	/**
	 * 加载属性结构
	 */
	List<DrawingInfoVO> tree();

	/**
	 * 自定义数据库查询结果
	 * @return
	 */
	List<DrawingInfoVO> getList(Map<String,Object>  drawingInfo);
	/**
	 * 根据中间表查询
	 */
	DrawingInfoVO getDrawingInfoByNodeId(Long nodeId);

	/**
	 * 根据图纸编号 查找图纸基本信息
	 * @param drawingNumber
	 * @return
	 */

	DrawingInfo getDrawingInfoByDrawingNumber(String drawingNumber);

	/**
	 * 获取bom详情
	 * @param drawingNumber
	 * @param drawingName
	 * @return
	 */
	DrawingInfo getDrawingInfo(@Param("drawingNumber") String drawingNumber, @Param("drawingName") String drawingName);
}
